package com.health.tablebean.webservice;

import android.content.Context;

import com.health.NovaApplication;
import com.health.db.FDbManager;
import com.health.tablebean.GRAVIDA_POSTPARTUM;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

/**
 * 产后访视
 * Created by Administrator on 2018/2/24 0024.
 */

public class PostpartumVisit {
    private String breast;//乳房红肿检查结果标志，DM01-40_1 未见异常，DM01-40_2 异常
    private String breastDesc;//乳房异常具体内容
    private String createorg;//创建机构
    private String creater;//创建人
    private String createtime;//创建时间
    private String cut;//伤口愈合状况代码，DM01-40_1 未见异常，DM01-40_2 异常
    private String cutDesc;//伤口愈合异常描述,DM01-40_1 未见异常，DM01-40_2 异常
    private String dbp;//舒张压(mmHg)
    private String fetusTimes;//产次
    private String healthDesc;//健康状况详细描述
    private String healthStateClassification;//		综合健康状态分类，DM01-40_1 未见异常，DM01-40_2 异常
    private String inputMan;//		随访医生姓名
    private String lyma;//		恶露状况代码，DM01-40_1 未见异常，DM01-40_2 异常
    private String lymaDesc;//		恶露描述
    private String maternalHealthGuide;//		孕产妇健康指导类别代码
    private String maternalHealthOther;//		健康指导其他描述
    private String maternalPsychology;//		心理状况详细描述
    private String nextVisitDate;//	下次访视日期
    private String otherState;//	其他异常情况及处理
    private String outDiagnose;//	转诊标识，DM01-11_1 无，DM01-11_2 有
    private String personalid;//	城乡居民健康档案编号
    private String res1;//	健康状况中 分类  异常的具体内容
    private String res5;//	分娩时间
    private String res6;//	出院时间
    private String sbp;//    收缩压( mHg)
    private String temperature;//    体温(℃)
    private String uterus;//	宫体异常标志，DM01-40_1 未见异常，DM01-40_2 异常
    private String uterusDesc;//	宫体异常描述
    private String visitDate;//	访视日期
    private Rollout rollOut;

    public String getBreast() {
        return breast;
    }

    public void setBreast(String breast) {
        this.breast = breast;
    }

    public String getBreastDesc() {
        return breastDesc;
    }

    public void setBreastDesc(String breastDesc) {
        this.breastDesc = breastDesc;
    }

    public String getCreateorg() {
        return createorg;
    }

    public void setCreateorg(String createorg) {
        this.createorg = createorg;
    }

    public String getCreater() {
        return creater;
    }

    public void setCreater(String creater) {
        this.creater = creater;
    }

    public String getCreatetime() {
        return createtime;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    public String getCut() {
        return cut;
    }

    public void setCut(String cut) {
        this.cut = cut;
    }

    public String getCutDesc() {
        return cutDesc;
    }

    public void setCutDesc(String cutDesc) {
        this.cutDesc = cutDesc;
    }

    public String getDbp() {
        return dbp;
    }

    public void setDbp(String dbp) {
        this.dbp = dbp;
    }

    public String getFetusTimes() {
        return fetusTimes;
    }

    public void setFetusTimes(String fetusTimes) {
        this.fetusTimes = fetusTimes;
    }

    public String getHealthDesc() {
        return healthDesc;
    }

    public void setHealthDesc(String healthDesc) {
        this.healthDesc = healthDesc;
    }

    public String getHealthStateClassification() {
        return healthStateClassification;
    }

    public void setHealthStateClassification(String healthStateClassification) {
        this.healthStateClassification = healthStateClassification;
    }

    public String getInputMan() {
        return inputMan;
    }

    public void setInputMan(String inputMan) {
        this.inputMan = inputMan;
    }

    public String getLyma() {
        return lyma;
    }

    public void setLyma(String lyma) {
        this.lyma = lyma;
    }

    public String getLymaDesc() {
        return lymaDesc;
    }

    public void setLymaDesc(String lymaDesc) {
        this.lymaDesc = lymaDesc;
    }

    public String getMaternalHealthGuide() {
        return maternalHealthGuide;
    }

    public void setMaternalHealthGuide(String maternalHealthGuide) {
        this.maternalHealthGuide = maternalHealthGuide;
    }

    public String getMaternalHealthOther() {
        return maternalHealthOther;
    }

    public void setMaternalHealthOther(String maternalHealthOther) {
        this.maternalHealthOther = maternalHealthOther;
    }

    public String getMaternalPsychology() {
        return maternalPsychology;
    }

    public void setMaternalPsychology(String maternalPsychology) {
        this.maternalPsychology = maternalPsychology;
    }

    public String getNextVisitDate() {
        return nextVisitDate;
    }

    public void setNextVisitDate(String nextVisitDate) {
        this.nextVisitDate = nextVisitDate;
    }

    public String getOtherState() {
        return otherState;
    }

    public void setOtherState(String otherState) {
        this.otherState = otherState;
    }

    public String getOutDiagnose() {
        return outDiagnose;
    }

    public void setOutDiagnose(String outDiagnose) {
        this.outDiagnose = outDiagnose;
    }

    public String getPersonalid() {
        return personalid;
    }

    public void setPersonalid(String personalid) {
        this.personalid = personalid;
    }

    public String getRes1() {
        return res1;
    }

    public void setRes1(String res1) {
        this.res1 = res1;
    }

    public String getRes5() {
        return res5;
    }

    public void setRes5(String res5) {
        this.res5 = res5;
    }

    public String getRes6() {
        return res6;
    }

    public void setRes6(String res6) {
        this.res6 = res6;
    }

    public String getSbp() {
        return sbp;
    }

    public void setSbp(String sbp) {
        this.sbp = sbp;
    }

    public String getTemperature() {
        return temperature;
    }

    public void setTemperature(String temperature) {
        this.temperature = temperature;
    }

    public String getUterus() {
        return uterus;
    }

    public void setUterus(String uterus) {
        this.uterus = uterus;
    }

    public String getUterusDesc() {
        return uterusDesc;
    }

    public void setUterusDesc(String uterusDesc) {
        this.uterusDesc = uterusDesc;
    }

    public String getVisitDate() {
        return visitDate;
    }

    public void setVisitDate(String visitDate) {
        this.visitDate = visitDate;
    }

    public Rollout getRollOut() {
        return rollOut;
    }

    public void setRollOut(Rollout rollOut) {
        this.rollOut = rollOut;
    }

    public static List<PostpartumVisit> convertData(Context context, String times) {
        List<PostpartumVisit> datas = new ArrayList<>();
        FDbManager fdb = FDbManager.getInstance(context);
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        List<GRAVIDA_POSTPARTUM> infos = fdb.findAllByWhere(GRAVIDA_POSTPARTUM.class,
                "IS_UPDATE='" + "Y' AND CREATER='" + NovaApplication.getJgrno() + "'");
        if (infos != null && !infos.isEmpty()) {
            PostpartumVisit data = null;
            for (GRAVIDA_POSTPARTUM info : infos) {
                data = new PostpartumVisit();

                data.setBreast(info.getBREAST());//乳房红肿检查结果标志，DM01-40_1 未见异常，DM01-40_2 异常
                data.setBreastDesc(info.getBREAST_EX());//乳房异常具体内容
                data.setCreateorg(info.getCREATEORG());//创建机构
                data.setCreater(info.getCREATER());//创建人
                data.setCreatetime(formatter.format(info.getCREATED_DATE()));//创建时间
                data.setCut(info.getWOUND());//伤口愈合状况代码，DM01-40_1 未见异常，DM01-40_2 异常
                data.setCutDesc(info.getWOUND_EX());//伤口愈合异常描述,DM01-40_1 未见异常，DM01-40_2 异常
                data.setDbp(info.getLBLOODPRESSURE());//舒张压(mmHg)
                data.setFetusTimes(info.getFetusTimes());//产次
                data.setHealthDesc(info.getHEALTHCONDITION());//健康状况详细描述
                data.setHealthStateClassification(info.getCLASSIFICATION());//		综合健康状态分类，DM01-40_1 未见异常，DM01-40_2 异常
                data.setInputMan(info.getFOLLOWUPDOCTOR());//		随访医生姓名
                data.setLyma(info.getLOCHIA());//		恶露状况代码，DM01-40_1 未见异常，DM01-40_2 异常
                data.setLymaDesc(info.getLOCHIA_EX());//		恶露描述
                data.setMaternalHealthGuide(info.getADVISING());//		孕产妇健康指导类别代码
                data.setMaternalHealthOther(info.getADVISINGOTHER());//		健康指导其他描述
                data.setMaternalPsychology(info.getMENTALCONDITION());//		心理状况详细描述
                data.setNextVisitDate(formatter.format(info.getNEXTFOLLOWUP_DATE()));//	下次访视日期
                data.setOtherState(info.getOTHER());//	其他异常情况及处理
                data.setOutDiagnose(info.getREFERRAL());//	转诊标识，DM01-11_1 无，DM01-11_2 有
                data.setPersonalid(info.getARCHIVEID());//	城乡居民健康档案编号
                data.setRes1("");//	健康状况中 分类  异常的具体内容
                data.setRes5(formatter.format(info.getDeliveryTime()));//	分娩时间
                data.setRes6(formatter.format(info.getDischargeTime()));//	出院时间
                data.setSbp(info.getHBLOODPRESSURE());//    收缩压( mHg)
                data.setTemperature(info.getTEM());//    体温(℃)
                data.setUterus(info.getUTERUS());//	宫体异常标志，DM01-40_1 未见异常，DM01-40_2 异常
                data.setUterusDesc(info.getUTERUS_EX());//	宫体异常描述
                data.setVisitDate(formatter.format(info.getFOLLOWUP_DATE()));//	访视日期
                Rollout rollout = new Rollout();
                rollout.setHpc(info.getREFERRALREASON());
                rollout.setRollInRegion(info.getREFERRALORG());
                data.setRollOut(rollout);

                datas.add(data);
            }
        }
        return datas;
    }
}
